<ui:composition template="/template/threecolumn.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">


    
    <ui:define name="conteudo">
      <div id="form_style">
        <h3>Disciplinas</h3>
        <h:form id="form">
         <p:messages id="messages" showDetail="false" autoUpdate="true" closable="true" />  
            <f:event listener="#{alunoAcademicoMB.carregaNotas}" type="preRenderView" />
            <p:panel header="Minhas notas">
            <p:dataTable value="#{alunoAcademicoMB.alunoDisciplinas}" var="aluno"  rowStyleClass="#{aluno.media le 5 ? 'row-red' : 'row-green'}"
             emptyMessage="nenhum registro encontrado"
              paginator="#{alunoAcademicoMB.alunoDisciplinas.size() > 5}" rows="10" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks}
           {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" style="width: 100%" lazy="true">
					 <p:column>
                        <f:facet name="header">  
                         Disciplina 
                        </f:facet>
                        <h:outputText value="#{aluno.disciplina.nome}" />
                    </p:column>
					<p:column sortBy="#{nota1}">
						<f:facet name="header">  
                         Nota 1  
                        </f:facet>
						<h:outputText value="#{aluno.nota1}" />
					</p:column>
                    <p:column  sortBy="#{nota2}">
                        <f:facet name="header">  
                         Nota 2  
                        </f:facet>
                        <h:outputText value="#{aluno.nota2}" />
                    </p:column>
                    <p:column  sortBy="#{media}">
                        <f:facet name="header">  
                         Média  
                        </f:facet>
                        <h:outputText value="#{aluno.media}" />
                    </p:column>
                    <p:column>
                        <f:facet name="header">  
                         Situação  
                        </f:facet>
                        <h:outputText value="#{aluno.statusAprovacao.valor}" />
                    </p:column>
    

            </p:dataTable>
			</p:panel>
        </h:form>
      </div>
    </ui:define>
</ui:composition>
